#pragma once
#include <boost/noncopyable.hpp>
#include "ImportExport.h"

namespace ja2{ namespace sgp
{
	//! Clock manager.
	class ClockManager : boost::noncopyable
	{
		// Constants
	private:
		//! Timer ID.
		static short const MAIN_TIMER_ID = 1;

		// Attributes
	private:
		//! Main window.
		HWND m_Window;
		//! Start up time.
		std::uint_least32_t m_StartupTime;
		//! Current time.
		std::uint_least32_t m_CurrentTime;
		//! Current instance used for callback.
		static ClockManager *m_pInstance;

		// Operations
	public:
		//! Get current time.
		std::uint_least32_t clock() const;
	private:
		//! Timer callback.
		static void CALLBACK callback(HWND hWindow, UINT uMessage, UINT idEvent, DWORD dwTime);

		// Construction/Destruction
	public:
		JA2_SGP_API ClockManager(HWND hWnd);
		JA2_SGP_API ~ClockManager(void);
	};
} /*sgp*/} /*ja2*/
